package com.uplooking.controller;

import com.uplooking.service.AlterArtical;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.sql.SQLException;

public class AlterArticalController extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setContentType("application/json;charset=utf8");
        Integer id = Integer.valueOf(req.getParameter("id"));
        String title = req.getParameter("title");
        String artical = req.getParameter("artical");
        AlterArtical alterArtical = new AlterArtical();
        try {
            Integer alterArtical1 = alterArtical.getAlterArtical(id, title, artical);
            resp.getWriter().print(0);
        } catch (SQLException e) {
            e.printStackTrace();
        }

    }
}
